import $http from "@/utils/http"

const board = "/lowCode/board"
const boardCategoryManage = "/lowCode/boardCategoryManage"
const workBench = "/lowCode/workBench"
const label = "/lowCode/label"
const visualModule = "/lowCode/visualModule"
const boardPageTemplate = "/lowCode/boardPageTemplate"
const design = "/lowCode/design"

// 看板新增
export const addDashboard = params => $http.post(`${board}/addDashboard`, params)
// 看板批量删除
export const batchDelDashboard = params => $http.post(`${board}/batchDelDashboard`, params)
// 看板修改
export const upDashboard = (params,type = 1) => $http.post(`${board}/upDashboard?type=${type}`, params)
// 获取看板详情
export const getDashboardById = params => $http.get(`${board}/getDashboardById`, {params})
// 看板申请上下线
export const kanBanOnlineOrOffline = params => $http.post(`${board}/applyOnlineOrOffline`, params)
// 看板申请收藏
export const applyStore = id => $http.post(`${board}/applyStore?id=${id}`)
// 看板申请调用
export const applySubscribe = params => $http.post(`${board}/applySubscribe?id=${params.id}&subEndTime=${params.subEndTime}`)
// 看板申请历史记录
export const getApplyHistorical = params => $http.get(`${board}/getApplyHistorical`, {params})
// 查看看板、分类树型结构
export const getDashboardAndCategoryTreeByType = params => $http.get(`${board}/getDashboardAndCategoryTreeByType`, {params})

// 查询分类树形结构
export const getDashboardCategoryTree = params => $http.get(`${boardCategoryManage}/getDashboardCategoryTree`, {params})
// 通过Pid获取分类和看板列表
export const getCategoryAndDashboardListByPid = params => $http.get(`${boardCategoryManage}/getCategoryAndDashboardListByPid`, {params})

// 可视化组件-保存分析设置
export const componentAnalysisAdd = params => $http.post(`${visualModule}/add`, params)
// 可视化组件-修改分析设置
export const componentAnalysisUpdate = params => $http.post(`${visualModule}/update`, params)
// 可视化组-分页查询组件
export const componentQuery = params => $http.post(`${visualModule}/query`, params)
// 可视化组件-数据查询
export const componentDataQuery = params => $http.post(`${visualModule}/chartDataQuery`, params)
// 看板分类修改
export const upDashboardCategory = params => $http.post(`${board}/upDashboardCategory`, params)
// 多维分析-图表-数据查询
export const dataQuery = params => $http.post(`${design}/dataQuery`, params)

// 查询单维度默认值
export const dataSignalQuery =  params => $http.post(`${design}/dataSignalQuery`, params)
// 可视化组件-分类管理-获取分类树
export const getCmTree = params => $http.post(`${boardCategoryManage}/getCmTree`, params)
export const getDM = params => $http.get(`${boardCategoryManage}/getDM`, params)
// 分享码校验
export const valid = params => $http.post(`${board}/valid`, params)


export const getDashboardList = params => $http.get(`${board}/getDashboardList`, {params})
// 图片上传
export const uploadPhoto = data => $http.post(`${board}/uploadPhoto`, data)
// 看板分类新增
export const addDashboardCategory = params => $http.post(`${boardCategoryManage}/addDashboardCategory`, params)
// 看板分类批量删除
export const batchDelDashboardCategory = params => $http.post(`${boardCategoryManage}/batchDelDashboardCategory`, params)

// 模板新增
export const addTemplate = params => $http.post(`${boardPageTemplate}/addTemplate`, params)
// 获取模板列表
export const getTemplateList = params => $http.get(`${boardPageTemplate}/getTemplateList`, {params})


// 审批申请
export const auditApply = params => $http.post(`${workBench}/auditApply`, params)
// 个人工作台
export const personalWorkBench = params => $http.get(`${workBench}/personalWorkBench`, {params})

// Top20标签
export const labelTop20 = params => $http.get(`${label}/top`, {params})
// 模糊查询标签
export const getLabelByName = params => $http.get(`${label}getLabelByName`, {params})

// 新增需求
// export const addRequirement = params => $http.post(`${dasRequirement}addRequirement`, params)

// 附件上传
// export const uploadFile = params => $http.post(`${dasRequirement}uploadFile`, params)
